package com.ncut.api.client;

import com.ncut.entity.AddressBook;
import com.ncut.entity.User;
import com.ncut.result.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @FileName UserClient
 * @Description
 * @Author Sword
 * @date 2025-08-06
 **/

@FeignClient(value = "user-service")
public interface UserClient {

    /**
     * 根据userId查询用户
     *
     * @param id
     * @return
     */
    @GetMapping("/user/user/{id}")
    Result<User> getByUserId(@PathVariable Long id);

    /**
     * 根据addressBookId查询地址
     *
     * @param id
     * @return
     */
    @GetMapping("/user/addressBook/{id}")
    Result<AddressBook> getByAddressBookId(@PathVariable Long id);

    /**
     * 根据map查询每日总用户数量
     *
     * @param map
     * @return
     */
    @GetMapping("/user/user/count")
    Integer countByMap(@RequestParam Map<String, Object> map);
}
